<template>
    <div class="box">
      <div class="nav">
        <router-link to="/gerenxinxi">
          <img src="../../assets/lyl/image/tuijian/BMQD-1.png" alt="">
        </router-link>
        <p>头像</p>
      </div>

      <img @click="change2()" class="yuan" :src="src" alt="">

      <div @click="change2()" v-if="com" class="footer">
        <ul @click.stop>
          <li>从手机相册中选择</li>
          <li>拍照</li>
          <li @click="change2()">取消</li>
        </ul>
      </div>
    </div>
</template>

<script>
  import faker from 'faker'
    export default {
      name: "Touimg",
      data(){
        return {
          src:faker.image.avatar(),
          com:false
        }
      },
      methods:{
        change2(){
          this.com = !this.com;
        }
      }
    }
</script>

<style scoped>
  .nav{
    width: 100%;
    background: #e53e42;
    padding: 3.5rem 0;
    display: flex;
    justify-content: center;
  }
  .nav a{
    position: absolute;
    left: 2rem;
    color: #fff;
    font-size: 34px;
  }
  .nav p{
    font-size: 34px;
    color:#fff;
  }

  .yuan{
    display: block;
    width: 50rem;
    height: 50rem;
    line-height: 50rem;
    text-align: center;
    font-size: 36px;
    border-radius: 50%;
    background: #fff;
    margin: 7rem auto;
  }
  .box{
    position: relative;
    background: #f2f2f2;
  }
  .box .footer{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
  }
  .box .footer ul{
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    background: #fff;
  }
  .box .footer ul li{
    height: 10rem;
    border-bottom: 1px solid #ccc;
    text-align: center;
    line-height: 10rem;
    font-size: 28px;
  }
</style>
